package com.sinosoft.dsp.component.bpm.util;

import java.util.ArrayList;
import java.util.List;

import javax.faces.model.SelectItem;

/**
 * BPM流程的图片类型
 * 
 * @author 潘巍（Peter Pan）
 * @since 2011-5-15 下午08:03:05
 */
public class BpmImageType {

	public static final String PACKAGE_ICON_PATH_PREFIX = "component/bpm/dir/";

	public static final String DEFINE_ICON_PATH_PREFIX = "component/bpm/define/";

	public static final String ICON_PATH_SUFFIX = ".png";

	// 所有包图标
	public static final List<SelectItem> packageIconItems;

	public static final String defaultPackageIcon = "01";

	// 所有流程定义图标
	public static final List<SelectItem> defineIconItems;

	public static final String defaultDefineIcon = "01";

	static {
		packageIconItems = new ArrayList<SelectItem>();
		packageIconItems.add(new SelectItem("01", "01"));
		packageIconItems.add(new SelectItem("02", "02"));
		packageIconItems.add(new SelectItem("03", "03"));
		packageIconItems.add(new SelectItem("04", "04"));
		packageIconItems.add(new SelectItem("05", "05"));

		defineIconItems = new ArrayList<SelectItem>();
		defineIconItems.add(new SelectItem("01", "01"));
		defineIconItems.add(new SelectItem("02", "02"));
		defineIconItems.add(new SelectItem("03", "03"));
		defineIconItems.add(new SelectItem("04", "04"));
		defineIconItems.add(new SelectItem("05", "05"));

	}

	/**
	 * 通过ID获得包图标的Src
	 * 
	 * @param id
	 * @return
	 */
	public static String getPackageIconPath(String id) {
		return PACKAGE_ICON_PATH_PREFIX + id + ICON_PATH_SUFFIX;
	}

	/**
	 * 通过ID获得流程定义图标的Src
	 * 
	 * @param id
	 * @return
	 */
	public static String getDefineIconPath(String id) {
		return DEFINE_ICON_PATH_PREFIX + id + ICON_PATH_SUFFIX;
	}
}
